﻿@model ConferenceUserMasterModel
@{
	ViewBag.Title = Resources.ConferenceUserMaster + ConstValues.strDash + ViewBag.ConferenceName;
}
<div id="menuBar" style="height:35px;">
	<div style="float: left; padding: 5px 5px; font-weight: bold; text-align: left;">
		@Resources.FullName：<input id="selName" class="easyui-textbox" style="height:27px; width:200px;" />&nbsp;&nbsp;
		@Resources.Mail：<input id="selMail" class="easyui-textbox" style="height:27px; width:200px;" />&nbsp;&nbsp;
		<a href="javascript:void(0);" class="easyui-linkbutton" iconcls="icon-search" onclick="searchData();">@Resources.Search</a>&nbsp;&nbsp;
		@if ((User as ICISPrincipal).IsSSA || (User as ICISPrincipal).CSAList.Contains(Model.ConferenceId) || Utility.HasConferenceRole((User as ICISPrincipal), Model.ConferenceId, ConstValues.FunctionId.ConferenceUserMaster, RoleType.添加))
		{
			<a href="javascript:void(0);" class="easyui-linkbutton" iconcls="icon-add" onclick="addData();" plain="true">@Resources.Create</a>
		}
	</div>
	<div class="clear"></div>
</div>
<div id="dataGrid"></div>

@section bodyParts {
<div id="addWindow" class="easyui-window"
     title="@Resources.ConferenceUserMaster" data-options="closed:true,minimizable:false,maximizable:false,iconCls:'icon-save'"
     style="width:1200px; display:none;">
	<div class="main">
		<div class="box clearfix">
			<h3 id="addWindowTitle" class="tit01"></h3>
			<form id="addDetail" method="post">
				@Html.AntiForgeryToken()
				<table width="100%" height="100%" id="addTblDetail" cellpadding="0" cellspacing="1" border="0" class="tastyle01">
					<tr>
						<td style="text-align: right;" class="w1 c1">@Resources.Mail：</td>
						<td style="text-align: left;" class="w2 c2">
							<input id="selAddMail" name="selAddMail" class="easyui-textbox" style="height:27px; width:300px;" />
						</td>
						<td style="text-align: right;" class="w1 c1">@Resources.UserName：</td>
						<td style="text-align: left;" class="w2 c2">
							<input id="selAddName" name="selAddName" class="easyui-textbox" style="height:27px; width: 220px;" />
							&nbsp;&nbsp;<input type="button" class="gbtn" onclick="searchAddData();" value="@Resources.Search" />
						</td>
					</tr>
					<tr><td colspan="4"><div id="addGrid"></div></td></tr>
					<tr>
						<td style="text-align: right;" class="w1 c1">@Resources.RoleName：</td>
						<td style="text-align: left;" class="w2 c2">
							<input id="roleList" name="roleList" class="easyui-combobox" style="height:27px; width:300px;" />
						</td>
						<td style="text-align: right;" class="w1 c1">@Resources.UserGroupName：</td>
						<td style="text-align: left;" class="w2 c2">
							<input id="groupList" name="groupList" class="easyui-combobox" style="height:27px; width:300px;" />
							<input type="hidden" id="hdnIds" name="allId" />
						</td>
					</tr>
				</table>
			</form>
			<div class="btnDiv">
				<input type="button" class="gbtn" onclick="saveAddData();" value="@Resources.Save" />&nbsp;&nbsp;
				<input type="button" class="rbtn" onclick="$('#addWindow').window('close');" value="@Resources.Cancel" />
			</div>
		</div>
	</div>
</div>
<div id="actionWindow" class="easyui-window"
     title="@Resources.ModifyRole" data-options="closed:true,minimizable:false,maximizable:false,iconCls:'icon-save'"
     style="width:1200px; display:none;">
	<div class="main">
		<div class="box clearfix">
			<h3 id="actionWindowTitle" class="tit01">@Resources.ModifyRole</h3>
			<form id="actionDetail" method="post">
				@Html.AntiForgeryToken()
				<table width="100%" height="100%" id="actionTblDetail" cellpadding="0" cellspacing="1" border="0" class="tastyle01">
					<tr>
						<td style="text-align: right;" class="w1 c1">@Resources.UserName：</td>
						<td style="text-align: left;" class="w2 c2">
							<input type="hidden" id="hidUserId" name="userId" />
							<input type="hidden" id="hidConferenceId" name="conferenceId" />
							<input id="tRoleName" class="easyui-textbox" style="height:27px; width:300px;" disabled />
						</td>
						<td style="text-align: right;" class="w1 c1">@Resources.RoleName：</td>
						<td style="text-align: left;" class="w2 c2">
							<select id="ddlAction" name="roleId" class="easyui-combobox" style="height:27px; width:220px;" data-options="editable:false,required:true"></select>
							&nbsp;&nbsp;<input type="button" class="gbtn" onclick="saveActionData();" value="@Resources.Create" />
						</td>
					</tr>
				</table>
			</form>
			<div id="actionGrid"></div>
		</div>
	</div>
</div>
<div id="groupWindow" class="easyui-window"
	title="@Resources.EditUserGroup" data-options="closed:true,minimizable:false,maximizable:false,iconCls:'icon-save'"
	style="width:1200px; display:none;">
	<div class="main">
		<div class="box clearfix">
			<h3 id="groupWindowTitle" class="tit01">@Resources.EditUserGroup</h3>
			<form id="groupDetail" method="post">
				@Html.AntiForgeryToken()
				<table width="100%" height="100%" id="groupTblDetail" cellpadding="0" cellspacing="1" border="0" class="tastyle01">
					<tr>
						<td style="text-align: right;" class="w1 c1">@Resources.UserName：</td>
						<td style="text-align: left;" class="w2 c2">
							<input type="hidden" id="groUserId" name="userIdGro" />
							<input type="hidden" id="groConferenceId" name="conferenceIdGro" />
							<input type="hidden" id="hidID" name="id" />
							<input id="groRoleName" class="easyui-textbox" style="height:27px; width:300px;" disabled />
						</td>
						<td style="text-align: right;" class="w1 c1">@Resources.UserGroupName：</td>
						<td style="text-align: left;" class="w2 c2">
							<select id="ddlGroup" name="groupId" class="easyui-combobox" style="height:27px; width:220px;" data-options="editable:false,required:true"></select>
							&nbsp;&nbsp;<input type="button" class="gbtn" onclick="saveGroupData();" value="@Resources.Create" />
						</td>
					</tr>
				</table>
			</form>
			<div id="groupGrid"></div>
		</div>
	</div>
</div>
}

@section Scripts {
<script>
	common.setCurrentMenu("ConferenceUserMaster");
	common.setCurrentParentMenu("#menu_a7");

	$(function () {
		$("#selName").textbox("textbox").bind("keydown", function (e) {
			if (e.keyCode == 13) {
				searchData()
			}
		});
		$("#selMail").textbox("textbox").bind("keydown", function (e) {
			if (e.keyCode == 13) {
				searchData()
			}
		});
		$("#hidConferenceId").val("@Model.ConferenceId");
		$("#dataGrid").datagrid({
			url: "@Url.Action(nameof(ConferenceUserMasterController.GetData),
					nameof(ConferenceUserMasterController).GetControllerName(), new { ConferenceId = Model.ConferenceId })",
			method: "get",
			singleSelect: true,
			width: $(window).width() - 285,
			height: $(window).height() - 158,
			nowrap: false,
			pagination: true,
			pageSize: @ConstValues.DefaultGridRows,
			striped: true,
			toolbar: "#toolBar",
			pageSize: 100,
			pageList: [100, 200, 300, 400, 500],
			frozenColumns: [[
				{ field: "id", hidden: true },
				@if ((User as ICISPrincipal).IsSSA || (User as ICISPrincipal).CSAList.Contains(Model.ConferenceId) ||
					Utility.HasConferenceRole((User as ICISPrincipal), Model.ConferenceId, ConstValues.FunctionId.ConferenceUserMaster, RoleType.修改))
				{
					<text>
					{
						field: "operate", title: "@Resources.Operate", align: "center", width: 250,
						formatter: function(value, rec) {
							var strInfo = "<a href='#' style='color:#FF8C00;font-weight:bold;text-decoration:underline;' onclick='actionData(\""
									+ rec.id + "\",\""+ rec.userName + "\")'>@Resources.ModifyRole</a>";
							strInfo += "&nbsp;|&nbsp;";
							strInfo += "<a href='#' style='color:#66CDAA;font-weight:bold;text-decoration:underline;' onclick='groupData(\""
								+ rec.id + "\",\""+ rec.userName + "\")'>@Resources.EditUserGroup</a>";

							return strInfo;
						}
					},
					</text>
				}
				{ field: "userName", title: "@Resources.UserName", align: "center", sortable: true, width: 150 },
				{ field: "mail", title: "@Resources.Mail", align: "center",  sortable: true, width: 250 },
			]],
			columns: [[
				{ field: "familyName", title: "@Resources.FamilyName", align: "center", sortable: true, width: 150 },
				{ field: "firstName", title: "@Resources.FirstName", align: "center", sortable: true, width: 150 },
				{ field: "fullName", title: "@Resources.FullName", align: "center", sortable: true, width: 200 },
				{ field: "gender", title: "@Resources.Gender", align: "center", sortable: true, width: 150 },
				{ field: "birthday", title: "@Resources.Birthday", align: "center", sortable: true, width: 150 },
				{ field: "affiliation", title: "@Resources.Affiliation", align: "center", sortable: true, width: 150 },
				{ field: "title", title: "@Resources.Title", align: "center", sortable: true, width: 150 },
				{ field: "degree", title: "@Resources.Degree", align: "center", sortable: true, width: 150 },
				{ field: "telephone", title: "@Resources.Telephone", align: "center", sortable: true, width: 150 },
				{ field: "mobile", title: "@Resources.Mobile", align: "center", sortable: true, width: 150 },
				{ field: "country", title: "@Resources.Country", align: "center", sortable: true, width: 150 },
				{ field: "state", title: "@Resources.State", align: "center", sortable: true, width: 150 },
				{ field: "city", title: "@Resources.City", align: "center", sortable: true, width: 150 },
				{ field: "address", title: "@Resources.Address", align: "center", sortable: true, width: 300 },
				{ field: "zipCode", title: "@Resources.ZipCode", align: "center", sortable: true, width: 150 },
				{
					field: "ocisCode", title: "@Resources.OcisCodeField", align: "center", sortable: true, width: 350,
					formatter: function (value, rec) {
						if (rec.ocisCodelist.length > 1) {
							return "<a href='javascript:void(0)' style='color:#DC143C;font-weight:bold;'  id='rowTp"+rec.id+"' >@Resources.MultiOcis</a>";
						} else {
							return value;
						}
					}
				},
				{ field: "department", title: "@Resources.Department", align: "center", sortable: true, width: 150 },
				{ field: "passwordFailed", title: "@Resources.PasswordWrongCount", align: "center", sortable: true, width: 150 },
				{ field: "isLocked", title: "@Resources.IsLocked", align: "center", sortable: true,  width: 150 },
				{ field: "remark", title: "@Resources.Remark", align: "center", sortable: true, width: 200 },
				{ field: "creator", title: "@Resources.Creator", align: "center", sortable: true, width: 150 },
				{ field: "createIP", title: "@Resources.CreateIP", align: "center", sortable: true, width: 150 },
				{ field: "createDate", title: "@Resources.CreateDate", align: "center", sortable: true, width: 150 },
			]],
			onBeforeLoad: function(param) {
				param.conferenceId = $("#hidConferenceId").val();
				param.random = Math.random();
			},
			onLoadSuccess:function(data) {
				for(i=0; i<data.rows.length; i++) {
					$("#rowTp"+data.rows[i].id).tooltip({
						position: "right",
						content: '<span style="color:#fff">'+ data.rows[i].ocisCode+'</span>',
						onShow: function(){
							$(this).tooltip("tip").css({
								backgroundColor: "#666",
								borderColor: "#666"
							});
						}
					});
				}
			}
		});

		$(window).resize(function () {
			$("#dataGrid").datagrid("resize", {
				width: $(window).width() - 285,
				height: $(window).height() - 158
			});
		});

		$("#groupWindow").window({
			onOpen: function () {
				$(this).scrollTop(0);
			},
			top: ($(window).height() - 600) * 0.5
		});

		$("#addWindow").window({
			onOpen: function () {
				$(this).scrollTop(0);
			},
			top: ($(window).height() - 600) * 0.5
		});

		$("#actionWindow").window({
			onOpen: function () {
				$(this).scrollTop(0);
			},
			top: ($(window).height() - 600) * 0.5
		});
	});

	function searchData() {
		$("#dataGrid").datagrid("load", {
			SelName: $("#selName").textbox("getValue"),
			SelMail: $("#selMail").textbox("getValue")
		});
	}

	function addData() {
		$("#addWindowTitle").text("@Resources.Create");
		$("#selAddMail").textbox("setValue","");
		$("#selAddName").textbox("setValue","");
		$("#addGrid").datagrid({
			url: "@Url.Action(nameof(ConferenceUserMasterController.GetAddData),
					nameof(ConferenceUserMasterController).GetControllerName(), new { ConferenceId = Model.ConferenceId })",
			method: "get",
			fitColumns: true,
			height: 325,
			nowrap: false,
			pageSize: @ConstValues.DefaultGridRows,
			striped: true,
			columns: [[
				{ field: "chk", align: "center", checkbox: true },
				{ field: "userName", title: "@Resources.UserName", align: "center",  width: 150 },
				{ field: "mail", title: "@Resources.Mail", align: "center",   width: 250 },
			]],
			onBeforeLoad: function(param) {
				param.conferenceId = $("#hidConferenceId").val();
				param.random = Math.random();
				param.selAddMail = $("#selAddMail").textbox("getValue");
				param.selAddName = $("#selAddName").textbox("getValue");
				if (param.selAddMail == "" && param.selAddName == "")
				{
					return false;
				}
			},
		});
		$("#addGrid").datagrid("loadData", []);
		$("#roleList").combobox({
			editable: false,
			valueField: "id",
			textField: "actionName",
			url: "@Url.Action(nameof(ConferenceUserMasterController.GetAction),
					nameof(ConferenceUserMasterController).GetControllerName())",
			onLoadSuccess: function(data) {
				orgCount = data.length;
			},
			onShowPanel: function () {
				if (orgCount < 10) {
					$(this).combobox("panel").height("auto");
				} else {
					$(this).combobox("panel").height(200);
				}
			},
			onBeforeLoad: function(param) {
				param.conferenceId = $("#hidConferenceId").val();
				param.groupId = $("#hidRoleId").val();
				param.random = Math.random();
			},
		});
		$("#groupList").combobox({
			editable: false,
			valueField: "id",
			textField: "actionName",
			url: "@Url.Action(nameof(ConferenceUserMasterController.GetGroup),
					nameof(ConferenceUserMasterController).GetControllerName())",
			onLoadSuccess: function(data) {
				orgCount = data.length;
			},
			onShowPanel: function () {
				if (orgCount < 10) {
					$(this).combobox("panel").height("auto");
				} else {
					$(this).combobox("panel").height(200);
				}
			},
			onBeforeLoad: function(param) {
				param.conferenceId = $("#hidConferenceId").val();
				param.random = Math.random();
			},
		});

		$("#addWindow").window("open");
	}

	function searchAddData() {
		if($("#selAddMail").textbox("getValue")=="" && $("#selAddName").textbox("getValue")==""){
			common.showError("@Resources.MsgFillNameAndMail");

		}
		$("#addGrid").datagrid("load", {
			SelAddName: $("#selAddName").textbox("getValue"),
			SelAddMail: $("#selAddMail").textbox("getValue"),
		});
	}

	function saveAddData() {
		if($("#roleList").combobox("getValue")=="" && $("#groupList").combobox("getValue") ==""){
			common.showError("@Resources.MsgFillRoleAndGroup");
			return
		}
		var rows = $("#addGrid").datagrid("getChecked");
		if (rows.length > 0) {
			var ids = "";
			for (var i = 0; i < rows.length; i++) {
				ids += i == 0 ? "" : "&";
				ids += rows[i].id;
			}
			$("#hdnIds").val(ids);
			var isValid = $("#addDetail").form("validate");
			if (isValid) {
				$.messager.confirm("@Resources.Save", "@Resources.CfmSave", function (r) {
					if (r) {
						var loading = layer.load(0,  {
							shade: [0.4,"#fff"]
						});
						$.post("@Url.Action(nameof(ConferenceUserMasterController.CreateRoleAndGroup),
								nameof(ConferenceUserMasterController).GetControllerName(), new { ConferenceId = Model.ConferenceId })",
						$("#addDetail").serialize(),
						function(data, textStatus, jqXHR) {
							layer.close(loading);
							if (data.result == "@ConstValues.AjaxFailResult") {
								common.showError(data.message);
							} else {
								common.showSuccess(data.message, true);
								$("#addGrid").datagrid("reload");
								$("#dataGrid").datagrid("reload");
							}
						}
						);
					}
				});
			}
		} else {
			$.messager.alert("", "@Resources.MsgRecordMust", "warning");
		}
	}

	function actionData(id, roleName) {
		$("#hidUserId").val(id);
		$("#hidConferenceId").val("@Model.ConferenceId");
		$("#actionGrid").datagrid({
			url: "@Url.Action(nameof(ConferenceUserMasterController.GetActionData),
					nameof(ConferenceUserMasterController).GetControllerName())",
			method: "get",
			fitColumns: true,
			height: 478,
			nowrap: false,
			pageSize: @ConstValues.DefaultGridRows,
			striped: true,
			toolbar: "#actionToolBar",
			columns: [[
				{
					field: "roleName", title: "@Resources.RoleName", align: "center", width: 150,
					formatter: function(value, rec) {
						var tmp = rec.roleName == null ? "" : rec.roleName.replace(new RegExp("'",'g'),"’").replace(new RegExp('"','g'),"“");
					    	var strInfo = "<a href='#' style='color:#DC143C;font-weight:bold;text-decoration:underline;' onclick='deleteActionData(\""
								+ rec.id + "\",\"" + tmp + "\")'>@Resources.Delete【" + tmp + "】</a>";
					    	return strInfo;
					}
				},
				{ field: "userName", title: "@Resources.UserName", align: "center", width: 150 },
				{ field: "actionName", title: "@Resources.ActionName", align: "center", width: 150 },
			]],
			onBeforeLoad: function(param) {
				param.conferenceId = $("#hidConferenceId").val();
				param.userId = $("#hidUserId").val();
				param.random = Math.random();
			},
			onLoadSuccess: function (data) {
				$(this).datagrid("autoMergeCells", ["roleName"]);
			}
		});
		$("#tRoleName").textbox("setValue",roleName);
		var orgCount = 0;
		$("#ddlAction").combobox({
			editable: false,
			required: true,
			valueField: "id",
			textField: "actionName",
			url: "@Url.Action(nameof(ConferenceUserMasterController.GetAction),
					nameof(ConferenceUserMasterController).GetControllerName())",
			onLoadSuccess: function(data) {
				orgCount = data.length;
			},
			onShowPanel: function () {
				if (orgCount < 10) {
					$(this).combobox("panel").height("auto");
				} else {
					$(this).combobox("panel").height(200);
				}
			},
			onBeforeLoad: function(param) {
				param.conferenceId = $("#hidConferenceId").val();
				param.groupId = $("#hidRoleId").val();
				param.random = Math.random();
			},
		});

		$("#actionWindow").window("open");
	}

	function saveActionData() {
		var isValid = $("#actionDetail").form("validate");

		if (isValid) {
			$.messager.confirm("@Resources.Save", "@Resources.CfmSave", function (r) {
				if (r) {
					var loading = layer.load(0,  {
						shade: [0.4,"#fff"]
					});
					$.post("@Url.Action(nameof(ConferenceUserMasterController.CreateAction),
							nameof(ConferenceUserMasterController).GetControllerName(), new { ConferenceId = Model.ConferenceId })",
						$("#actionDetail").serialize(),
						function(data, textStatus, jqXHR) {
							layer.close(loading);
							if (data.result == "@ConstValues.AjaxFailResult") {
								common.showError(data.message);
							} else {
								common.showSuccess(data.message, true);
								$("#actionGrid").datagrid("reload");
								$("#dataGrid").datagrid("reload");
							}
						}
					);
				}
			});
		}
	}

	function deleteActionData(id, name) {
		var confirmMessage = "@Resources.CfmDelete";
		confirmMessage = confirmMessage.replace(/\{0\}/g, name);
		$.messager.confirm("@Resources.Delete", confirmMessage, function (r) {
			if (r) {
				$("#hidID").val(id);
				$.post("@Url.Action(nameof(ConferenceUserMasterController.DeleteAction),
						nameof(ConferenceUserMasterController).GetControllerName(), new { ConferenceId = Model.ConferenceId })",
					$("#groupDetail").serialize(),
					function(data, textStatus, jqXHR) {
						if (data.result == "@ConstValues.AjaxFailResult") {
							common.showError(data.message);
						} else {
							common.showSuccess(data.message, true);
							$("#actionGrid").datagrid("reload");
							$("#dataGrid").datagrid("reload");
						}
					}
				);
			}
		});
	}

	function groupData(id, roleName) {
		$("#groUserId").val(id);
		$("#groupGrid").datagrid({
			url: "@Url.Action(nameof(ConferenceUserMasterController.GetGroupData),
					nameof(ConferenceUserMasterController).GetControllerName())",
			method: "get",
			fitColumns: true,
			height: 478,
			nowrap: false,
			pageSize: @ConstValues.DefaultGridRows,
			striped: true,
			toolbar: "#actionToolBar",
			columns: [[
				{
					field: "groupName", title: "@Resources.Operate", align: "center", width: 150,
					formatter: function(value, rec) {
						var tmp = rec.groupName == null ? "" : rec.groupName.replace(new RegExp("'",'g'),"’").replace(new RegExp('"','g'),"“");
						var strInfo = "<a href='#' style='color:#DC143C;font-weight:bold;text-decoration:underline;' onclick='deleteGroupData(\""
								+ rec.id + "\",\"" + tmp + "\")'>@Resources.Delete【" + tmp + "】</a>";
						return strInfo;
					}
				},
				{ field: "roleName", title: "@Resources.RoleName", align: "center", width: 150 },
				{ field: "actionName", title: "@Resources.ActionName", align: "center", width: 150 },

			]],
			onBeforeLoad: function(param) {
				param.conferenceId = $("#hidConferenceId").val();
				param.userIdGro = $("#groUserId").val();
				param.random = Math.random();
			},
			onLoadSuccess: function (data) {
				$(this).datagrid("autoMergeCells", ["groupName"]);
			}
		});
		$("#groRoleName").textbox("setValue",roleName);
		var orgCount = 0;
		$("#ddlGroup").combobox({
			editable: false,
			required: true,
			valueField: "id",
			textField: "actionName",
			url: "@Url.Action(nameof(ConferenceUserMasterController.GetGroup),
					nameof(ConferenceUserMasterController).GetControllerName())",
			onLoadSuccess: function(data) {
				orgCount = data.length;
			},
			onShowPanel: function () {
				if (orgCount < 10) {
					$(this).combobox("panel").height("auto");
				} else {
					$(this).combobox("panel").height(200);
				}
			},
			onBeforeLoad: function(param) {
				param.conferenceId = $("#hidConferenceId").val();
				param.random = Math.random();
			},
		});
		$("#groupWindow").window("open");
	}

	function saveGroupData() {
		var isValid = $("#groupDetail").form("validate");
		$("#groConferenceId").val("@Model.ConferenceId");
		if (isValid) {
			$.messager.confirm("@Resources.Save", "@Resources.CfmSave", function (r) {
				if (r) {
					var loading = layer.load(0,  {
						shade: [0.4,"#fff"]
					});
					$.post("@Url.Action(nameof(ConferenceUserMasterController.CreateGroup),
							nameof(ConferenceUserMasterController).GetControllerName(), new { ConferenceId = Model.ConferenceId })",
						$("#groupDetail").serialize(),
						function(data, textStatus, jqXHR) {
							layer.close(loading);
							if (data.result == "@ConstValues.AjaxFailResult") {
								common.showError(data.message);
							} else {
								common.showSuccess(data.message, true);
								$("#groupGrid").datagrid("reload");
								$("#dataGrid").datagrid("reload");
							}
						}
					);
				}
			});
		}
	}

	function deleteGroupData(id, name) {
		var confirmMessage = "@Resources.CfmDelete";
		confirmMessage = confirmMessage.replace(/\{0\}/g, name);
		$.messager.confirm("@Resources.Delete", confirmMessage, function (r) {
			if (r) {
				$("#hidID").val(id);

				$.post("@Url.Action(nameof(ConferenceUserMasterController.DeleteGroup),
						nameof(ConferenceUserMasterController).GetControllerName(), new { ConferenceId = Model.ConferenceId })",
					$("#groupDetail").serialize(),
					function(data, textStatus, jqXHR) {
						if (data.result == "@ConstValues.AjaxFailResult") {
							common.showError(data.message);
						} else {
							common.showSuccess(data.message, true);
							$("#groupGrid").datagrid("reload");
							$("#dataGrid").datagrid("reload");
						}
					}
				);
			}
		});
	}
</script>
}